Var iList: Integer; tmpList: TStringList; Const ctTxtFile = 'C:\Test\Customer\Data\folderlista.txt'; Begin psVSA := ''; psExitCode:= 0; psLogWrite(1, '', 'Reading Filter from File: ' + ctTxtFile); tmpList := TStringList.Create; Try Try tmpList.LoadFromFile(ctTxtFile); For iList := 0 to (tmpList.Count - 1) Do psVSA := psVSA + Trim(tmpList.Strings[iList]) + ';'; If psVSA <> '' Then Begin psExitCode := 1; psLogWrite(1, '', 'psVSA: ' + psVSA); End Else psLogWrite(1, '', 'No folder entries in txt file: ' + ctTxtFile); Except psLogWrite(1, '', 'LoadFromFileError, ' + ctTxtFile); End; Finally tmpList.Free; End; End.